#ifndef WIDGET_TOPO_GRAPH_H
#define WIDGET_TOPO_GRAPH_H

#include "example_diagramscene.h"

#include <QWidget>

namespace Ui {
class WidgetTopoGraph;
}

class WidgetTopoGraph : public QWidget
{
    Q_OBJECT

public:
    explicit WidgetTopoGraph(QWidget *parent = nullptr);
    ~WidgetTopoGraph();
    QMap<int, ExampleBaseNode*> gui_node_map;;
    QMenu *itemMenu;
    QAction *deleteAction;
    QAction *toFrontAction;
    QAction *sendBackAction;

    void createActions();

    void createMenus();

    ExampleDiagramScene *scene;
    QGraphicsView *view;

    void update_chart();
    void on_node_changed();
private slots:

    void deleteItem();

private:
    Ui::WidgetTopoGraph *ui;

    // QWidget interface
protected:
    void contextMenuEvent(QContextMenuEvent *event);
};

#endif // WIDGET_TOPO_GRAPH_H
